package com.prototype.protoType;

import java.util.Scanner;

/**
 * @author Vhong
 * @version 1.0
 * 正方形类
 */
public class Square implements Shape {
    @Override
    public Object clone() {
        Square s = null;
        try {
            s = (Square) super.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println("复制正方形失败!");
        }
        return s;
    }

    @Override
    public void countArea() {
        int a;
        System.out.println("这是一个正方形，请输入正方形的边长：");
        Scanner s = new Scanner(System.in);
        int i = s.nextInt();
        System.out.println("正方形的面积为：" + i * i + "\n");
    }
}
